<?php

class App_View_Helper_Pluralize extends Zend_View_Helper_Url
{

    /**
     * Pluralizes english words
     * 
     * Note: custom suffix is passed if word should have "es" suffix
     * $irregular word will be returned in case of irregular words
     * 
     * @param string $singular
     * @param int $count
     * @param string $custom_suffix
     * @param bool|string $irregular
     * @return string
     */
    public function pluralize($singular, $count, $custom_suffix=false, $irregular = false)
    {
        if ($count == 1)
        {
            return $singular;
        }

        if ($irregular)
        {
            return $irregular;
        }

        return!$custom_suffix ? $singular . 's' : $singular . $custom_suffix;
    }

}